
<template>
  <div >
    <div class="headWrap">
      <div class="content_title">直播管理</div>
      <div  class="search">
        <el-form :inline="true"  class="demo-form-inline searchBox">
          <el-form-item label="关键字">
            <el-input
              placeholder="关键词搜索"
              icon="search"
              :on-icon-click="searchByWord">
            </el-input>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <div >
      <el-tabs type="card" v-model="activeName" @click="handleClick">
        <el-tab-pane label="正在直播" name="0"></el-tab-pane>
        <el-tab-pane label="已完成直播" name="1"></el-tab-pane>
      </el-tabs>
      <el-table
        :data="tableData"
        stripe
        style="width: 100%">
        <el-table-column
          prop="date"
          label="直播封面">
        </el-table-column>
        <el-table-column
          prop="id"
          label="标题">
        </el-table-column>
        <el-table-column
          prop="address"
          label="直播码">
        </el-table-column>
        <el-table-column
          prop="address"
          label="直播记者">
        </el-table-column>
        <el-table-column
          prop="address"
          label="直播时间">
        </el-table-column>
        <el-table-column
          prop="address" v-if="activeName==='1'"
          label="结束时间">
        </el-table-column>
        <el-table-column v-if="activeName==='1'"
          label="管理">
          <template slot-scope="scope">
            <el-button @click="detail()"  size="small">查看详情</el-button>
            <el-button @click="downVideo()" type="info" size="small">下载视频</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>


<script>
  export default {
    data () {
      return {
        tableData: [{'id': 1}],
        activeName: '0'
      };
    },
    methods: {
      // 关键字搜索
      searchByWord () {
        alert('关键字搜索');
      },
      // 切换tab页签
      handleClick (tab, event) {
        this.activeName = tab.name;
        alert('切换Tab页签');
      },
      // 查看详情
      detail () {
        this.$router.push('/liveManager/liveDetail');
        alert('查看详情');
      }
    },
    components: {},
    created: function () {
    }
  };
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
